public class TestDemo {
    public static void main(String[] args) {
        Student s1=new Student();//创建对象
        s1.name="张三";
        s1.gender="女";
        s1.age=17;
        s1.score=97.5;
        s1.show();
        s1.doClass();

        Student s2=new Student();//创建对象
        s2.name="王五";
        s2.gender="男";
        s2.age=16;
        s2.score=90;
        s2.show();
        s2.doHomework();

        System.out.println("=====================================");

        Date date1=new Date();
        date1.setDate(2025,2,20);
        date1.func();

        System.out.println("=====================================");

        //Person类
        Person person1=new Person();//调用不带参数的构造函数（在无参构造函数加上 this.name="wangwu";则name初始化为wangwu
        //person1.doClass();
        person1.name="Lily";
        person1.age=17;
        person1.doClass();//为什么之前强调写函数时要加上public static-->因为不加的话调用函数时要“引用.”，而加上就是静态方法
                         //不依赖于对象，可直接调用
        Person person2=new Person("zhangsan",16);//调用两个参数的构造函数
        person2.doClass();
        person2.name="zhangsi";
        person2.doClass();
    }
}
